package com.david.cms.service;
import javax.inject.Inject;

import org.springframework.stereotype.Service;

import com.david.basic.model.Pager;
import com.david.cms.dao.IMemberDao;
import com.david.cms.model.Member;
@Service("memberService")
public class MemberService implements IMemberService {
	private IMemberDao memberdao;

	@Inject
	public void setMemberdao(IMemberDao memberdao) {
		this.memberdao = memberdao;
	}
	public void addMember(Member member) throws Exception {
		this.memberdao.addMember(member);
	}

	public Member searchMemberById(int id) throws Exception {
		// TODO Auto-generated method stub
		return this.memberdao.searchMember(id);
	}

	public Member searchMember(String loginName, String password)
			throws Exception {
		// TODO Auto-generated method stub
		return this.memberdao.login(loginName, password);
	}

	public Pager<Member> searchMemberByPage(Pager page) throws Exception {
		// TODO Auto-generated method stub
		return this.memberdao.searchMemberByPage(page);
	}

	public void deleteMember(int id) throws Exception {
		this.memberdao.deleteMember(id);
	}

	public Member searchMemberByLoginName(String loginName) {
		// TODO Auto-generated method stub
		return this.memberdao.isUse(loginName);
	}
	public void updateMember(Member member) {
		this.memberdao.updateMember(member);
		
	}

}
